#include <REGX52.H>
sbit LED = P0 ^ 0;
void delay_ms(unsigned int ms)//延迟函数，下面调用只需要输入延迟时间即可
{
    unsigned int i, j;
    for (i = 0; i < ms; i++)
    {
        for (j = 0; j < 123; j++)
            ;
    }
}

void main()
{
    LED = 1;
    while (1)
    {
        LED = ~LED;//取反，控制小灯闪烁，引脚一会高一会低
        delay_ms(150);
    }
}